package com.ruoyi.web.controller.app;


import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.ResponseResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.CashHistory;
import com.ruoyi.system.domain.IncomeHistory;
import com.ruoyi.system.service.IncomeHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "用户端:回款记录接口")
@RestController
@RequestMapping("/app/incomeHis")
public class IncomeController extends AppController {

    @Resource
    private IncomeHistoryService incomeHistoryService;

    @ApiOperation(value = "回款列表")
    @PostMapping("list")
    public ResponseResult<List<CashHistory>> list() {
        this.startPage();
        LoginUser loginUser = SecurityUtils.getLoginUser();
        IncomeHistory cashHistory = new IncomeHistory();
        cashHistory.setUserId(loginUser.getUserId());
        List<IncomeHistory> list = incomeHistoryService.findList(cashHistory);
        return this.setSuccessResult(list);
    }


}
